import request from "../utils/request.js";
let baseUrl = import.meta.env.VITE_APP_BASE_API_CHAT;

// 聊天列表
export const chatList = (data) => {
  return request(
    baseUrl + "/chatmgt/messageSender/wxfindUserMessageList",
    "post",
    data
  );
};

// 获取历史消息
export const searchMessages = (data) => {
  return request(
    baseUrl + "/chatmgt/messageSender/wxsearchMessagesByIds",
    "post",
    data
  );
};

//修改消息状态
/**
 * 
 * @param {
  "groupId": 1333655599,
  "requestIds": [
    666666
  ],
  "QorA": "A",
  "updateStatus": 0
} 
 */
export const updateMsgStatus = (data) => {
  return request(
    baseUrl + "/chatmgt/messageSender/updateMessageStatus",
    "post",
    data
  );
};

// 后端放入缓存
export const setRedis = (data) => {
  return request(baseUrl + "/chatmgt/exec/Messagecache", "post", data);
};

//删除聊天记录
export const clearChatHistory = (data) => {
  return request(baseUrl + "/chatmgt/messageSender/clearHistory", "post", data);
};
